package java8;

import java.util.Scanner;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/4/17 11:02
 * 邮箱验证
 * emailMatcher="[a-zA-Z0-9]+@[a-zA-Z0-9]+\\.[a-zA-Z0-9]+"
 * 使用正则表达式判断邮箱是否合法
 * https://www.nowcoder.com/practice/8f908eeee4aa412ca88304f0acbaa1f9?tpId=220&tqId=2109873&ru=%2Fexam%2Foj&qru=%2Fta%2Fprimary-grammar-java%2Fquestion-ranking&sourceUrl=%2Fexam%2Foj
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        String emailMatcher="[a-zA-Z0-9]+@[a-zA-Z0-9]+\\.[a-zA-Z0-9]+";
        if (str.matches(emailMatcher)) {
            System.out.println("邮箱格式合法");
        } else {
            System.out.println("邮箱格式不合法");
        }
    }
}
